/*
 * @Author: huangpan02
 * @Date: 2023-02-20 11:25:09
 * @LastEditTime: Please set LastEditors
 * @LastEditors: Please set LastEditors
 * @Description: 计量设备名称管理API
 */
import request from '@/utils/request'
import { faceProducerApiUrl } from '@/api/config'
// let _apiUrl = 'http://192.168.10.19:10400'

export default {
  /**
   * @description: 获取列表
   * @param {Object} data：body参数
   * @return {Promise}
   */
  list(data) {
    return request({
      url: `${faceProducerApiUrl}/mdInfo/getPageMdInfo`, method: 'post', data
    })
  },
  /**
 * @description: 
 * @param {Object} data：body参数
 * @return {Promise}
 */
  create(data) {
    return request({
      url: `${faceProducerApiUrl}/mdInfo/insertMdInfo`, method: 'post', data
    })
  },
  /**
   * @description: 
   * @param {Object} data：body参数
   * @return {Promise}
   */
  edit(data) {
    return request({
      url: `${faceProducerApiUrl}/mdInfo/editMdInfo`, method: 'post', data
    })
  },
  /**
   * @description: 删除
   * @param {String} id：业务id
   * @return {Promise}
   */
  delete(data) {
    return request({
      url: `${faceProducerApiUrl}/mdInfo/deleteByPrimaryKey?id=${data.id}`, method: 'post', data
    })
  },
  /**
   * @description: 详情
   * @param {String} id：业务id
   * @return {Promise}
   */
  getDetail({ id }) {
    return request({
      url: `${faceProducerApiUrl}/mdInfo/getMdInfoById?id=${id}`, method: 'get'
    })
  },
  /**
  * @description: 导出
  * @param {Object} data：body参数
  * @return {Promise}
  */
  exportData(data) {
    return request({
      url: `${faceProducerApiUrl}/mdInfo/exportMdInfo`,
      method: 'post',
      data,
      responseType: 'blob',
      headers: {
        'Content-Type': 'application/json'
      }
    })
  },
}